from django.db import models
from django.conf import settings


# Create your models here.
class BaseModel(models.Model):
    create_at = models.DateTimeField("创建时间", auto_now_add=True)
    update_at = models.DateTimeField("更新时间", auto_now=True)
    delete_at = models.DateTimeField("删除时间", null=True)


class Option(BaseModel):
    name = models.CharField(max_length=200, null=False, blank=False, unique=True, verbose_name='参数名称')
    classify = models.CharField(max_length=30, null=False, blank=False, verbose_name='分类')
    value = models.FloatField(max_length=50, null=True, blank=True, verbose_name='值')
    description = models.CharField(max_length=200, null=True, blank=True, verbose_name='参数说明')

    def __str__(self):
        return self.name

    class Meta:
        unique_together = (('name', 'classify',),)
        verbose_name = '配置项'
        verbose_name_plural = '配置项'
        ordering = ['id']
        db_table = 'reminder_option'
